package myjava.date;

import java.util.Calendar;
import java.util.Scanner;

/**
 * @author Yancy
 * @program springioctest
 * @create 2020-09-08
 */
public class WeekTest {

  public static void main(String[] args) {

    Scanner scanner = new Scanner(System.in);
    System.out.println("输入一个月份：");
    int month = scanner.nextInt();
    System.out.println("输入日：");
    int day = scanner.nextInt();
    Calendar calendar = Calendar.getInstance();
    calendar.set(calendar.get(Calendar.YEAR), month-1, day);


    int date = calendar.get(Calendar.DAY_OF_WEEK);

    switch (date) {
      case 1:
        System.out.println("星期日");
        break;
      case 2:
        System.out.println("星期一");
        break;
      case 3:
        System.out.println("星期二");
        break;
      case 4:
        System.out.println("星期三");
        break;
      case 5:
        System.out.println("星期四");
        break;
      case 6:
        System.out.println("星期五");
        break;
      default:
        System.out.println("星期六");
    }
  }
}
